<div class="order">
    <div class="item-category">
        <ul>
            <li style="color: #FC9F01;">
                <input type="button" value="Xuất ra file Excel" class="submit" onclick="AdminController.exportOrderToExcel();">
            </li>
        </ul>
    </div>
    <div class="order-item">
        <ul>
            <li class="title-first">Sắp xếp:</li>
            <li>
                <a class="<?php echo ($order == 1) ? 'selected' : ''; ?>" onclick="AdminController.getProductOrder('<?php echo $type; ?>', '1', '<?php echo $page;?>');">Ngày đặt hàng tăng</a>
            </li>
            <li>
                <a class="<?php echo ($order == 2) ? 'selected' : ''; ?>" onclick="AdminController.getProductOrder('<?php echo $type; ?>', '2', '<?php echo $page;?>');">Ngày đặt hàng giảm</a>
            </li>
        </ul>
    </div>
</div>

<table cellpadding="0" cellspacing="0" width="100%" align="left" class="table-list">
    <col width="50%">
    <col width="50%">
    <?php if (isset($aryOrderDetail[0])) { ?>
        <?php foreach ($aryOrderDetail as $key => $value) { ?>
            <tr class="<?php echo ($key % 2 == 0) ? 'alt' : '' ?>">
                <td>
                    <ul class="ul-list-order">
                        <li class="list-order-header">Họ tên</li>
                        <li class="list-order-detail"><?php echo $value['order_detail_full_name']; ?></li>

                    </ul>
                    <ul class="ul-list-order">
                        <li class="list-order-header">Địa chỉ</li>
                        <li class="list-order-detail"><?php echo $value['order_detail_address']; ?></li>
                    </ul>
                    <ul class="ul-list-order">
                        <li class="list-order-header">Điện thoại</li>
                        <li class="list-order-detail"><?php echo $value['order_detail_phone_number']; ?></li>
                    </ul>
                    <ul class="ul-list-order">
                        <li class="list-order-header">Email</li>
                        <li class="list-order-detail"><?php echo $value['order_detail_email']; ?></li>
                    </ul>
                    <ul class="ul-list-order">
                        <li class="list-order-header">Ngày</li>
                        <li class="list-order-detail"><?php echo date("d/m/Y", strtotime($value['order_detail_created_date'])); ?></li>
                    </ul>
                </td>
                <td>
                    <ul class="ul-list-order">
                        <li class="list-order-product-header w300p">Tên sản phẩm</li>
                        <li class="list-order-product-header w60p center">Số lượng</li>
                    </ul>
                    <?php foreach ($aryProductOrder as $key2 => $product) { ?>
                        <?php if ($product['product_order_detail_id'] == $value['order_detail_id']) { ?>
                            <ul class="ul-list-order">
                                <li class="w300p"><?php echo $product['product_order_product_name']; ?></li>
                                <li class="w60p center">
                                    <?php echo $product['product_order_total_product']; ?>&nbsp;/&nbsp;<?php echo $product['product_order_product_unit']; ?>
                                </li>
                            </ul>
                        <?php } ?>
                    <?php } ?>

                </td>
            </tr>
            <tr class="<?php echo ($key % 2 == 0) ? 'alt' : '' ?>">
                <td colspan="2" align="right">
                    <span style="color: #FDA703;">
                        <?php if ($value['order_detail_is_process'] == 0) { ?>
                            (Đơn hàng mới)
                        <?php } else if ($value['order_detail_is_process'] == 1) { ?>
                            (Đã xử lý)
                        <?php } else if ($value['order_detail_is_process'] == 2) { ?>
                            (Đang chờ xử lý)
                        <?php } ?>
                    </span>
                    <span><a class="cpointer" onclick="AdminController.viewDetailOrder(<?php echo $value['order_detail_id']; ?>, '<?php echo $type; ?>')">Xem chi tiết</a></span>
                </td>
            </tr>
        <?php } ?>
    <?php } else { ?>
        <tr>
            <td colspan="2">
                <div class="search_no_restul">
                    Không tìm thấy đơn hàng
                </div>
            </td>
        </tr>
    <?php } ?>
</table>
<div class="clear"></div>
<div align="right"><?php echo $strPaging; ?></div>


